using System;
using System.Collections.Generic;
using System.Text;
using Entities;
using DAL;

namespace BUS
{
    public class tbTrangThaiSPBUS
    {
        public static void Insert_TrangThaiSP(tbTrangThaiSP trangthaisp)
        {
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            trangthaispDAL.Insert(trangthaisp);
        }
        public static void Update_TrangThaiSP(tbTrangThaiSP trangthaisp)
        {
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            trangthaispDAL.Update(trangthaisp);
        }
        public static void Delete_TrangThaiSP(int iD)
        {
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            trangthaispDAL.Delete(iD);
        }
        public static tbTrangThaiSP.tbTrangThaiSPCollection Get(string where, int pageindex, int pagesize, string orderby, string orderdirection, out int total)
        {
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            return trangthaispDAL.Get(where, pageindex, pagesize, orderby, orderdirection, out total);
        }
        public static tbTrangThaiSP.tbTrangThaiSPCollection GetAll()
        {
            int total = 0;
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            return trangthaispDAL.Get("where 1=1", 0, 0, Entities.tbTrangThaiSP.tbTrangThaiSPColumns.IDTrangThaiSP.ToString(), "ASC", out total);
        }
        public static tbTrangThaiSP GetByID(int iD)
        {
            int total = 0;
            tbTrangThaiSPDAL trangthaispDAL = new tbTrangThaiSPDAL();
            tbTrangThaiSP.tbTrangThaiSPCollection trangthaispCollection = trangthaispDAL.Get("where " + tbTrangThaiSP.tbTrangThaiSPColumns.IDTrangThaiSP.ToString() + "=" + iD.ToString(), 0, 0, tbTrangThaiSP.tbTrangThaiSPColumns.IDTrangThaiSP.ToString(), "ASC", out total);
            if (trangthaispCollection.Count > 0)
                return trangthaispCollection[0];
            return null;
        }
    }
}
